//
//  WYCDetailedMessegeController.m
//  51信用卡
//
//  Created by 中企互联 on 2017/11/3.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import "WYCDetailedMessegeController.h"
#import "configuration.h"
#import "UIView+MJExtension.h"
@interface WYCDetailedMessegeController ()
@property (strong, nonatomic) IBOutlet UILabel *label;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *top;

@end

@implementation WYCDetailedMessegeController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"消息详细";
    [self loadMessage];
    //界面
    [self setupCreat];
}

- (void)setupCreat {
//    if (kDevice_Is_iPhoneX) {
//        
//    }
    self.top.constant = kDevice_Is_iPhoneX ? 93 : 89;
    self.label.text = _content;
    
//    UILabel *Detailedlabel = [[UILabel alloc] init];
////    Detailedlabel.frame = CGRectMake(40 * px, kDevice_Is_iPhoneX?69:83, ScreenWidth - 80 * px, 600 * px);
//    Detailedlabel.mj_x = 40;
//    Detailedlabel.mj_y = 93;
//    Detailedlabel.textAlignment = NSTextAlignmentLeft;
//    Detailedlabel.numberOfLines = 0;
//    Detailedlabel.text  = _content;
//    Detailedlabel.font = [UIFont systemFontOfSize:14];
//    [self.view addSubview:Detailedlabel];
}
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
    UIView * NavView = [[UIView alloc] init];
    NavView.frame = CGRectMake(0, 0, ScreenWidth, NavHeight);
    NavView.backgroundColor = wycMain;
    [self.view addSubview:NavView];

    CALayer *bottomLineLayer = [[CALayer alloc] init];
    bottomLineLayer.frame = CGRectMake(0, NavView.bounds.size.height - 0.5, NavView.bounds.size.width, 0.5);
    bottomLineLayer.backgroundColor = [UIColor redColor].CGColor;
    [NavView.layer addSublayer:bottomLineLayer];
    
    
    //返回按钮
    UIButton *  backbutton = [[UIButton alloc] init];
    [backbutton setImage:[UIImage imageNamed:@"Nav_back"] forState:UIControlStateNormal];
    [backbutton addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    backbutton.frame = CGRectMake(30 * px, titleY, 66 * px , 66 * px);
    [NavView addSubview:backbutton];
    
    UILabel * NavRigsterLabel = [[UILabel alloc] init];
    NavRigsterLabel.frame = CGRectMake(0, titleY, NavView.width, 68 * px);
    NavRigsterLabel.textColor = [UIColor whiteColor];
    NavRigsterLabel.font = [UIFont boldSystemFontOfSize:BigFont];
    NavRigsterLabel.textAlignment = NSTextAlignmentCenter;
    NavRigsterLabel.text = self.title;
    [NavView addSubview:NavRigsterLabel];
}
- (void)backClick{
    
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)loadMessage
{
    NSMutableDictionary * params = [NSMutableDictionary dictionary];
    params[@"messageId"] = self.messid;
    
    [HttpTool POST:receipt params:params success:^(NSURLSessionDataTask *task, id responseObject) {
                if ([[responseObject objectForKey:@"code"] intValue] == 0)
                {
        }
    } fail:^(NSURLSessionDataTask *task, NSError *error) {
        
    }];
}

@end
